home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ansi
/
sdsgnr.zip
/
SHOWSCR.C
< prev
next >
Wrap
Text File
|
1991-08-09
|
4KB
|
105 lines
/* Example of how to use screens saved as C source in your C program */
/*
This was compiled and tested with Turbo C 2.0, but should not
require much changes for Quick C.
*/
/*-------------------------------------------------------------------*/
#include <bios.h>
#include <conio.h>
#define COLORVIDEO 0xb800
#define SCRSIZE 4000
unsigned GLOBAL_videobase = COLORVIDEO;
/*-------------------------------------------------------------------*/
void showscreen (int screen[], int size, int vidmode)
{
int c;
unsigned ofs, i, j, reps;
ofs = 0;
j = 0;
if (vidmode == 40) {
textmode(C40);
}
else {
textmode(C80);
}
while (ofs < SCRSIZE && j < size) {
c = screen[j++];
if (c != 0) {
poke(GLOBAL_videobase,ofs,c);
ofs += 2;
}
else {
c = screen[j++];
reps = screen[j++];
reps = 2 * reps + ofs;
for (i = ofs; i < reps; i += 2) {
poke(GLOBAL_videobase,i,c);
}
ofs = i;
}
}
}
/*-------------------------------------------------------------------*/
main()
{
/*
After you create your screen with SD.EXE and save it as a
C source file, merge it into your program as follows:
*/
int EXAMPLE_vidmode = 80;
unsigned EXAMPLE_scr[] = {
28361,0,28365,78,28347,28346,0,28192,78,28346,28346,0,28192,4,12762,0,12740,29,12735,
0,28192,43,28346,28346,0,28192,4,12723,12633,12623,12629,12626,12576,12622,
12609,12621,12613,12602,12576,12576,0,12720,17,12723,0,28192,43,28346,28346,0,28192,4,
12736,0,12740,29,12761,0,28192,43,28346,28346,0,28192,20,25632,0,28192,43,-12512,-12457,
-12479,-12462,-12466,-12471,-12466,-12473,-12512,0,28192,5,28346,28346,0,28192,26,
28361,0,28365,21,28347,0,28192,16,12250,0,12228,5,12223,0,28192,6,28346,28346,0,28192,26,
28346,0,28192,21,28346,0,28192,16,12211,12064,12064,12228,12223,12089,12211,
0,28192,6,28346,28346,0,28192,26,28346,28192,28192,32544,-187,-168,-191,-179,
-176,-180,-187,-224,-173,-189,-174,-187,-187,-178,-224,
28192,28192,28192,28346,0,28192,16,12211,12064,12064,12228,12212,12088,12211,0,28192,6,
28346,28346,0,28192,26,28346,0,28192,21,28346,0,28192,16,12211,12064,12064,12228,12212,
12087,12211,0,28192,6,28346,28346,0,28192,26,28346,0,28192,21,28346,0,28192,16,12211,
12228,12048,12228,12212,12086,12211,0,28192,6,28346,28346,0,28192,26,28360,
0,28365,21,28348,0,28192,16,12211,12064,12064,12228,12212,12085,12211,0,28192,6,
28346,28346,0,28192,9,8154,0,8132,10,8127,0,28192,44,12211,12064,12064,12228,12212,
12084,12211,0,28192,6,28346,28346,0,28192,9,8115,7968,7968,7968,7985,0,7968,6,8115,
0,28192,44,12211,12064,12064,12228,12212,12083,12211,0,28192,6,28346,28346,0,28192,9,
8115,7968,7968,8180,0,7968,7,8115,0,28192,36,28448,0,28192,7,12211,12064,12064,
12228,12212,12082,12211,0,28192,6,28346,28346,0,28192,9,8115,7968,7968,8115,
7968,8056,7968,8036,8056,7968,7968,8115,0,28192,44,12211,12064,12064,
12228,12212,12081,12211,0,28192,6,28346,28346,0,28192,9,8115,7968,7968,8181,
0,7968,7,8115,0,28192,44,12211,12064,12064,12228,12249,12080,12211,0,28192,6,
28346,28346,28192,28192,9417,9421,9421,9403,28192,28192,28192,8115,7968,7984,0,7968,8,
8115,0,28192,12,0,24283,9,0,28192,23,12224,0,12228,5,12249,0,28192,6,28346,28346,28192,28192,
9402,28192,28192,9402,28192,28192,28192,8128,0,8132,10,8153,0,28192,12,24283,24096,
24288,24096,24102,24096,24298,24096,24283,0,28192,36,28346,28346,28192,28192,
9402,28192,28192,9402,0,28192,27,0,24283,9,0,28192,31,28428,0,28192,4,28346,28346,28192,28192,
9420,9421,9421,9418,0,9421,21,9403,0,28192,35,28174,28192,28192,28173,28192,28192,
28173,28192,28174,0,28192,6,28346,28346,28192,28192,9402,0,28192,24,9402,0,28192,4,
9417,0,9421,12,9403,0,28192,15,28174,28192,28192,28173,28192,28192,28174,28192,28192,
28173,0,28192,7,28346,28346,28192,28192,9402,0,28192,24,9402,0,28192,4,9402,0,28192,12,
9402,0,28192,13,28427,0,28192,18,28346,28346,28192,28192,9416,0,9421,24,9418,0,9421,4,
9418,0,9421,12,9404,0,28192,32,28346,28360,0,28365,78,28348
};
int EXAMPLE_size = 568;
/* Pass your screen to showscreen as follows */
showscreen (EXAMPLE_scr, EXAMPLE_size, EXAMPLE_vidmode);
}